package com.jinke.api.modules.third.shippo.model.response;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

import java.util.List;

/**
 * @projectName:
 * @title: ShippoTrackResponse
 * @description:
 * @see:
 * @author: hhp
 * @version: 1.0.0
 * @createTime: 2024/8/14 14:34
 */
@Data
public class ShippoTrackResponse {
    @JSONField(name = "address_from")
    private AddressInfo addressFrom;
    @JSONField(name = "address_to")
    private AddressInfo address_to;
    private String carrier;
    private String eta;
    private List<String> messages;
    private String metadata;
    @JSONField(name = "original_eta")
    private String originalEta;
    private ServiceLevel servicelevel;
    @JSONField(name = "tracking_history")
    private List<TrackingHistory> trackingHistory;
    @JSONField(name = "tracking_number")
    private String trackingNumber;
    @JSONField(name = "tracking_status")
    private TrackingHistory trackingStatus;
    private String transaction;

    @Data
    public static class AddressInfo {
        private String city;
        private String country;
        private String state;
        private String zip;
    }
    /*@Data
    public static class AddressTo {
        private String city;
        private String country;
        private String state;
        private String zip;
    }*/
    @Data
    public static class ServiceLevel {
        private String name;
        private String terms;
        private String token;
        @JSONField(name = "extended_token")
        private String extendedToken;
        @JSONField(name = "parent_servicelevel")
        private ServiceLevel parentServiceLevel;
    }
    @Data
    public static class TrackingHistory {
        private AddressInfo location;
        @JSONField(name = "object_created")
        private String objectCreated;
        @JSONField(name = "object_id")
        private String objectId;
        @JSONField(name = "object_updated")
        private String objectUpdated;
        private String status;
        private SubStatus substatus;
        @JSONField(name = "status_date")
        private String statusDate;
        @JSONField(name = "status_details")
        private String statusDetails;
    }
    @Data
    public static class SubStatus {
        private String code;
        private String text;
        @JSONField(name = "action_required")
        private Boolean actionRequired;
    }
    /*@Data
    public static class TrackingStatus {
        private AddressInfo location;
        @JSONField(name = "object_created")
        private String objectCreated;
        @JSONField(name = "object_id")
        private String objectId;
        @JSONField(name = "object_updated")
        private String objectUpdated;
        private String status;
        private SubStatus substatus;
        @JSONField(name = "status_date")
        private String statusDate;
        @JSONField(name = "status_details")
        private String statusDetails;
    }*/
}
